<html>
<head>
<style>
    #container {
        position: absolute;
        top: 0px;
        left: 400px;
        will-change: transform;
    }

    #red {
        position: absolute;
        top: 0px;
        left: -400px;
        height: 256px;
        width: 256px;
        background-color: red;
    }

    #green {
        position: absolute;
        left: 0px;
        top: 0px;
        width: 300px;
        height: 300px;
        background-color: green;
    }

    #layertree {
        position: absolute;
        left: 10000px;
        top: 0px;
    }

    body {
        overflow: hidden;
    }

</style>

<script>
    if (window.testRunner) {
        testRunner.dumpAsTextWithPixelResults();
        testRunner.waitUntilDone();
    }

    window.addEventListener('load', function() {
        if (window.testRunner) {
            document.getElementById("layertree").innerText = internals.layerTreeAsText(document);
            testRunner.notifyDone();
        }
    }, false);
</script>

<body>
    <!-- container has empty bounds, but is composited -->
    <div id="container">
        <!-- this red square should not appear over the green square -->
        <div id="red"></div>
    </div>

    <!-- This green square should composite because it overlaps the red one -->
    <div id="green"></div>

    <pre id="layertree"></pre>
</body>
</html>
